package cn.elwy.rcp.ui.explorer.core.handler;

import org.springframework.stereotype.Component;

import cn.elwy.rcp.core.model.ui.progress.ProgressMonitor;
import cn.elwy.rcp.ui.explorer.core.util.SvnUtil;
import cn.elwy.rcp.ui.explorer.core.vo.ProjectConfig;

@Component(SvnCheckHandler.ID)
public class SvnCheckHandler extends ProjectServiceHandler {

	public static final String ID = "svnCheckHandler";

	@Override
	public Object handler(ProjectConfig pc, ProgressMonitor monitor) {
		if (!pc.isTestSvn()) {
			return null;
		}
		return SvnUtil.isURLExist(pc.getScmUrl(), pc.getScmUser(), pc.getScmPassword());
	}

}
